﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace Lilium.RetailAudit.Data
{
	public static class RepositoryExtensions
	{
		public static int Count<TEntity>(this IRepository<TEntity> repository)
		{
			if (repository == null) throw new ArgumentNullException("repository");

			return repository.Count(Enumerable.Empty<object>());
		}

		public static int Count<TEntity>(this IRepository<TEntity> repository, params object[] disjunts)
		{
			if (repository == null) throw new ArgumentNullException("repository");

			return repository.Count(disjunts);
		}

		public static void Delete<TEntity>(this IRepository<TEntity> repository, params object[] disjunts)
		{
			if (repository == null) throw new ArgumentNullException("repository");

			repository.Delete(disjunts);
		}

		public static IEnumerable<TEntity> Select<TEntity>(this IRepository<TEntity> repository)
		{
			if (repository == null) throw new ArgumentNullException("repository");

			return repository.Select(Enumerable.Empty<object>());
		}

		public static IEnumerable<TEntity> Select<TEntity>(this IRepository<TEntity> repository, params object[] disjunts)
		{
			if (repository == null) throw new ArgumentNullException("repository");

			return repository.Select(disjunts);
		}
	}
}
